<?php
/**
* 系统公用函数库
*
* PHP version 5
*
* @package   Libaray
* @author    Weber Liu <weberliu@hotmail.com>
* @copyright 2010 Xingchangxinda Inc.
* @version   SVN: $Id: common.php 342 2011-06-16 03:28:36Z garbin $
*/

/**
 * 获取模型实例
 *
 * @param string $modelName 模型名
 *
 * @author    sunfengming
 * @return Models
 */
function model($modelName)
{
    static $models = array();
    $modelClass = '\\Project\\Apps\\Ecga\\Models\\' . $modelName;
    if (!isset($models[$modelClass])) {
        $models[$modelClass] = new $modelClass;
    }

    return $models[$modelClass];
}
